package com.cainiao.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.lang.model.element.NestingKind;
import javax.xml.crypto.dsig.keyinfo.RetrievalMethod;

/**
 * @author shkstart
 * @create 2021-08-06 15:37
 */
@Controller
public class ViewController {
    @RequestMapping("/testThymeleafView")
    public String testThymeleafView() {
        return "success";
    }

    /**
     * 转发到一个请求
     *
     * @return
     */
    @RequestMapping("/testForward")
    public String testForward() {
        //内部转发
        return "forward:/testThymeleafView";
    }

    @RequestMapping("/testRedirect")
    public String testRedirect() {
        //重定向到首页
        return "redirect:/testThymeleafView";
    }
}
